﻿using System;
using System.Collections.Generic;
using Zj.HttpCodeDemo.ConsoleApp.ModelFirst;

namespace Zj.HttpCodeDemo.ConsoleApp.Samples
{
    internal class EntityFrameworkModelFirstSample
    {
        internal static void Sample()
        {
            ModelFirstTestContainer1 ctx = new ModelFirstTestContainer1();
            var user = new User() { UserName = "test", Password = "123456", Age = 25 , UserLoginErrLogs=new HashSet<UserLoginErrLog>() { new UserLoginErrLog() { IPAddress = "192.168.9.14", LoginTime = DateTime.UtcNow }, new UserLoginErrLog() { IPAddress = "192.168.9.14", LoginTime = DateTime.UtcNow } , new UserLoginErrLog() { IPAddress = "192.168.9.14", LoginTime = DateTime.UtcNow } } };
            //user.UserLoginErrLogs.Add(new UserLoginErrLog() { IPAddress = "192.168.9.14", LoginTime = DateTime.UtcNow });
            ctx.User.Add(user);
            ctx.SaveChanges();
        }
    }
}